home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / dvlprstc.hqx / Developer Stack 1.3r / card_25575.txt < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.0 KB  |  40 lines

  1. -- card: 25575 from stack: in.3r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2202
  5. -- name: LineNumber
  6.  
  7.  
  8. -- part contents for background part 10
  9. ----- text -----
  10. 13
  11.  
  12. -- part contents for background part 19
  13. ----- text -----
  14. Functions
  15.  
  16. -- part contents for background part 3
  17. ----- text -----
  18. LineNumber
  19.  
  20. -- part contents for background part 2
  21. ----- text -----
  22. --
  23. --universal LineNumber function returns the line number for a location in any field
  24. --takes two parameters
  25. --name of a field..... "card field 2" - "field names" - name of me - the target - etc.
  26. --a set of coordinates.....  "32,318" - the clickLoc - the mouseLoc - etc.
  27. --lineNumber("card Field 1",the mouseLoc)
  28. --hold down the option key and click on this field to try it
  29. --
  30.  
  31. function lineNumber whatField,where
  32.   put item 2 of where - item 2 of rect of whatField into linNum
  33.   if style of whatField = "scrolling" then add scroll of whatField to linNum
  34.   put linNum div textHeight of whatField + 1 into linNum
  35.   return (linNum)
  36. end lineNumber
  37.  
  38. --
  39. -- Original function provided 3/88 by Scott McGilliard
  40. --